<!-- 后台页面的顶部 -->
<div id="navbar" class="navbar navbar-default">
	<div class="navbar-container" id="navbar-container">
		<div class="navbar-header pull-left">
			<a href="javascript:;" class="navbar-brand">
				<small>
					<!-- <img src="assets/avatars/logo.png" alt="" /> -->
					#(appName)
				</small>
			</a>
		</div>
			
		<div class="navbar-buttons navbar-header pull-right" role="navigation">
			<ul class="nav ace-nav">
				#include('_top_msg.html')

				<li class="light-blue">
					<a data-toggle="dropdown" href="#" class="dropdown-toggle">
					    <img class="nav-user-photo" src="#if(user?? && user.headimg??)#(user.headimg)#else static/admin/img/headimg.jpg #end" alt="Jason's Photo" />
						<span class="user-info">
							欢迎您<br />
							#if(user??)#(user.userName)#else超级管理员 #end
						</span>
						<i class="ace-icon fa fa-caret-down"></i>
					</a>
					<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
						<li>
							<a href="javascript:void(0)" onclick="updatePwd()">
								<i class="ace-icon fa fa-cog"></i>
								密码修改
							</a>
						</li>
						<!-- <li>
							<a href="javascript:void(0)" target="content">
								<i class="ace-icon fa fa-user"></i>
								个人信息
							</a>
						</li> -->
						<li class="divider"></li>
						<li>
							<a href="javascript:void(0)" onclick="outer()">
								<i class="ace-icon fa fa-power-off"></i>
								退出系统
							</a>
						</li>
					</ul>
				</li>
			</ul>
		</div>
	</div>
</div>
<script type="text/javascript">
	/** 系统退出登陆 */
	var outer = function(){
		layer.confirm('确认要退出系统吗?', {title : '系统提示'}, function(){
			loginOut();
		})
	}
	/** 实际退出执行的方法 */
	var loginOut = function(){
		Http.get('admin/outer', function(res){
			if(res.succeed){
				window.location.href = 'admin/';
			}
		})
	}
	
	/** 修改登陆密码的功能 */
	var updatePwd = function(){
		layer.open({
			type : 2, 
			title : '修改用户密码',
			area : ['400px', '300px'],
			resize: false,
			content : 'admin/changePwd',
		})
	}
</script>